import { service } from '@/service'

export const updateLogo = (data?: any) => {
  return service.request({
    url: 'system/config/updateLogo',
    method: 'POST',
    data
  })
}

export const updateLogoList = (params?: any) => {
  return service.request({
    url: 'system/config/list',
    method: 'get',
    params
  })
}

export const updateSysName = (data?: any) => {
  return service.request({
    url: 'system/config/updateSysName',
    method: 'POST',
    data
  })
}

export const defaultSubInfo = (data?: any) => {
  return service.request({
    url: 'system/sub_color/defaultSubInfo',
    method: 'POST',
    data
  })
}

export const useSub = (data?: any) => {
  return service.request({
    url: 'system/sub_color/useSub',
    method: 'POST',
    data
  })
}

export const userColorSave = (data?: any) => {
  return service.request({
    url: 'system/sub_color/userColorSave',
    method: 'POST',
    data
  })
}

export const getCollectSubList = (data?: any) => {
  return service.request({
    url: 'system/sub_color/collectSubList',
    method: 'POST',
    data
  })
}

export const saveColorConfig = (data?: any) => {
  return service.request({
    url: 'system/sub_color/saveColorConfig',
    method: 'POST',
    data
  })
}

export const collectSub = (data?: any) => {
  return service.request({
    url: 'system/sub_color/collectSub',
    method: 'POST',
    data
  })
}

export const delById = (id: number) => {
  return service.request({
    url: `system/sub_color/delCollectInfo`,
    method: 'POST',
    data: {
      id
    }
  })
}

// 版权
export const updOwnership = (data: any) => {
  return service.request({
    url: `system/config/updOwnership`,
    method: 'POST',
    data
  })
}

export const sysVersionPage = (data: any) => {
  return service.request({
    url: `system/config/sysVersionPage`,
    method: 'POST',
    data
  })
}

export const sysVersionSave = (data: any) => {
  return service.request({
    url: `system/config/sysVersionSave`,
    method: 'POST',
    data
  })
}

export const enumQuery = (classPath: any) => {
  return service.request({
    url: `hbsys-system/enum/query`,
    method: 'POST',
    data: {
      classPath
    }
  })
}

//黑白名单
export const getSysRules = (data?: any) => {
  return service.request({
    url: `system/sysip/getSysRules`,
    method: 'POST',
    data
  })
}

export const updSysRules = (data?: any) => {
  return service.request({
    url: `system/sysip/updSysRules`,
    method: 'POST',
    data
  })
}

export const sysipPage = (params?: any) => {
  return service.request({
    url: `system/sysip/page`,
    method: 'GET',
    params
  })
}

export const addWhiteList = (data?: any) => {
  return service.request({
    url: `system/sysip/addWhiteList`,
    method: 'POST',
    data
  })
}

export const cancleWhiteList = (data?: any) => {
  return service.request({
    url: `system/sysip/cancleWhiteList`,
    method: 'POST',
    data
  })
}

//数据删除阈值
export const addDataManagement = (data?: any) => {
  return service.request({
    url: `system/data_management/add`,
    method: 'POST',
    data
  })
}

export const delDataManagement = (data?: any) => {
  return service.request({
    url: `system/data_management/del`,
    method: 'POST',
    data
  })
}

export const getPageDataManagement = (data?: any) => {
  return service.request({
    url: `system/data_management/getPage`,
    method: 'POST',
    data
  })
}

export const updDataManagement = (data?: any) => {
  return service.request({
    url: `system/data_management/upd`,
    method: 'POST',
    data
  })
}

export const getUserAllData = (data?: any) => {
  return service.request({
    url: `system/data_management/getUserAllData`,
    method: 'POST',
    data
  })
}

export const certPage = (data?: any) => {
  return service.request({
    url: `system/cert/page`,
    method: 'POST',
    data
  })
}

export const regOverdue = (data?: any) => {
  return service.request({
    url: `system/cert/regOverdue`,
    method: 'POST',
    data
  })
}

export const certDel = (data?: any) => {
  return service.request({
    url: `system/cert/del`,
    method: 'POST',
    data
  })
}

export const certDetail = (data?: any) => {
  return service.request({
    url: `system/cert/detail`,
    method: 'POST',
    data
  })
}

export const backupPage = (data?: any) => {
  return service.request({
    url: `hbsys-system/backup/page`,
    method: 'POST',
    data
  })
}

export const backupDownload = (id?: number) => {
  return service.request({
    url: `hbsys-system/backup/download/pwd/${id}`,
    method: 'get'
  })
}

export const backupChange = (data?: any) => {
  return service.request({
    url: `hbsys-system/backup/change`,
    method: 'POST',
    data
  })
}

export const cancelBackup = () => {
  return service.request({
    url: `hbsys-system/backup/cancelBackup`,
    method: 'get'
  })
}

export const backup = () => {
  return service.request({
    url: `hbsys-system/backup/backup`,
    method: 'get'
  })
}
